package www.sofn.com.integral;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import www.sofn.com.domain.R;
import www.sofn.com.integral.domain.query.IntegralQuery;
import www.sofn.com.integral.domain.vo.IncomeDataVO;
import www.sofn.com.integral.domain.vo.IncomeInfoVO;

import java.util.List;
@RestController
@Tag(name="积分")
@RequestMapping("/integral")
public class IntegralController {

    @Resource
    private IntegralService integralService;

    @GetMapping
    @Operation(description = "获取收益信息")
    public R<List< IncomeInfoVO>> finalIncome(IntegralQuery query){
        return R.ok( integralService.finalIncome(query));
    }


    @GetMapping("income_info")
    @Operation(description = "收益数据")
    public R<IncomeDataVO> incomeInfo(){
        return R.ok( integralService.incomeInfo());
    }
}
